package com.hoshiicloud.common.feign;

import com.hoshiicloud.common.feign.fallback.BaseHystrixUserFeignFallback;
import com.hoshiicloud.common.rpc.Response;
import com.hoshiicloud.saleorder.dto.PlatStoreDTO;
import com.hoshiicloud.user.dto.platform.CompanyDto;
import com.hoshiicloud.user.dto.userCenter.MemberDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author ygd
 * @title: UserFeignService
 * @projectName hoshiicloud
 * @description: 用户域common service
 * @date 2019/9/16
 */
@FeignClient(name = "hoshiicloud-user", fallback = BaseHystrixUserFeignFallback.class)
public interface BaseUserFeignService {

    /**
     * 根据id获取租户
     *
     * @param id ID
     * @return Response
     */
    @RequestMapping(value = "/company/company/{id}", method = RequestMethod.GET)
    Response<CompanyDto> getCompanyById(@PathVariable("id") Long id);

    /**
     * 根据租户会员ID获取租户会员信息
     *
     * @param id 租户会员ID
     * @return Response
     */
    @RequestMapping(value = "/rbac/member/{id}", method = RequestMethod.GET)
    Response<MemberDto> getMemberById(@PathVariable("id") Long id);


    /**
     * 根据WxOpenId查询租户会员
     *
     * @param wxOpenId 微信用户唯一id
     * @return Response<MemberDto>
     */
    @RequestMapping(value = "/rbac/member/getMemberByWxOpenId", method = RequestMethod.GET)
    Response<MemberDto> getMemberByWxOpenId(@RequestParam("wxOpenId") String wxOpenId);



    /**
     * 根据id获取店铺
     *
     * @param id 店铺ID
     * @return Response<PlatStoreDTO>
     */
    @GetMapping(value = "/store/plat-store/{id}")
    Response<PlatStoreDTO> queryById(@PathVariable("id") Long id);


}
